Name :
Example6 : Stochastic

Variables : name,type,value
r,Integer,5
q,Integer,3
p,Integer,14

Description :
This indicator computes the  stochastic %K and %D lines.

Formula :
REM Computes the highest and lowest prices on p bars

hi = highest[p](high)
lo = lowest[p](low)

REM Let's build the oscillator

oscillator = (close - hi) / (hi - lo) * 100

REM We can now compute the Stochastic lines

lineK = average[q](oscillator)
lineD = average[r](lineK)

RETURN lineK AS "%K", lineD AS "%D"


